-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add more mssql datatypes #19105
add more mssql datatypes #19105
Conversation
test/modules/post/test/mssql.rb
Outdated
@@ -41,6 +41,57 @@ def test_console_query | |||
end | |||
end | |||
|
|||
def test_datatypes | |||
it "should support datetime TDS datatype" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of string matching the console we should test the Ruby result
[
query: 'select cast(null as datetime);', expected: [[nil]],
query: 'select cast('1990-01-02' as datetime);', expected: [['1990-01-02']],
...
].each do |test|
it "should execute the query #{test[:query]} and return #{test[:expected]}" do
ret = console.client.query(test[:query]) == test[:expected]
end
end
Which would make it easier to add more tests in the future, as well as ensuring we can test the nil
scenarios
b4e9bf2
to
1ff7d47
Compare
2362138
to
1050840
Compare
test/modules/post/test/mssql.rb
Outdated
{query: "select cast('1999999900' as numeric(16, 6));", expected: [[1999999900.0]]}, | ||
{query: "select cast(null as numeric(16, 6));", expected: [[nil]]}, | ||
].each do |test| | ||
it "should execute the query #{test[:query]} and return #{test[:expected] || 'nil'}" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would mark false
as nil
it "should execute the query #{test[:query]} and return #{test[:expected] || 'nil'}" do | |
it "should execute the query #{test[:query]} and return #{test[:expected].inspect}" do |
1050840
to
7659f52
Compare
7659f52
to
b4dccdf
Compare
Release NotesUpdates MSSQL modules to support querying multiple new column types: float, real, money, smallmoney, datetime, smalldatetime, and numeric |
This adds support for 7 new datatypes for MSSQL: float, real, money, smallmoney, datetime, smalldatetime, and numeric.
To test this, make sure you can connect to a remote mssql session, either via docker or VM.
use mssql_sql
run with credentials/connection info to the MSSQL instance, setting
sql
to a query that returns one of the new datatypes. ie:checking null as well
Validate that output response looks okay